<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title></title>
    <link href="https://cdn.staticfile.org/antd/3.26.9/antd.css" rel="stylesheet" />
</head>

<body>
    <div ng-app="spps" ng-controller="mainCtrl">
        <div class="container" style="padding: 50px">
            <es-table columns="columns" d-source="dataSource" row-selection="rowSelection"/>
        </div>
    </div>
    <script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script>
    <script>
        angular
            .module("spps", [])
            .controller("mainCtrl", function ($scope, $timeout) {
                $scope.columns = [
                    {
                        title: "批次",
                        key: "name",
                        width: "100px",
                    },
                    {
                        title: "航线",
                        key: "age",
                    },
                    {
                        title: "操作",
                        key: "action",
                        render: () => {
                            return `<a ng-click="handleClick()">Delete</a>`;
                        }
                    },
                ];

                $scope.dataSource = [
                    {
                        id: 1,
                        name: "AAA",
                        age: 32,
                    },
                    {
                        id: 2,
                        name: "BBB",
                        age: 42,
                    },
                ];

                $scope.rowSelection = {
                    onChange: (selectedRowKeys, selectedRows) => {
                        console.log(selectedRowKeys, selectedRows);
                    },
                    getCheckboxProps: (record) => ({
                        disabled: record.age === 42,
                    }),
                };

                $scope.handleClick = () => {
                    console.log("I am handleClick");
                };
            });
    </script>
    <script src="../../dist/Essa/Slot/Slot.js"></script>
    <script src="../../dist/Essa/Checkbox/Checkbox.js"></script>
    <script src="../../dist/Essa/Table/Table.js"></script>
</body>

</html>